/*
Template Name: Color Admin - Responsive Admin Dashboard Template build with Twitter Bootstrap 3.3.7
Version: 2.1.0
Author: Sean Ngu
Website: http://www.seantheme.com/color-admin-v2.1/admin/html/
*/
var handleSlimScroll = function () {
        "use strict";
        $("[data-scrollbar=true]").each(function () {
            generateSlimScroll($(this))
        })
    },
    generateSlimScroll = function (a) {
        if (!$(a).attr("data-init")) {
            var b = $(a).attr("data-height");
            b = b ? b : $(a).height();
            var c = {
                height: b,
                alwaysVisible: !0
            };
            /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ? ($(a).css("height", b), $(a).css("overflow-x", "scroll")) : $(a).slimScroll(c), $(a).attr("data-init", !0)
        }
    },
    handleSidebarMenu = function () {
        "use strict";
        $(".sidebar .nav > .has-sub > a").click(function () {
            var a = $(this).next(".sub-menu"),
                b = ".sidebar .nav > li.has-sub > .sub-menu";
            0 === $(".page-sidebar-minified").length && ($(b).not(a).slideUp(250, function () {
                $(this).closest("li").removeClass("expand")
            }), $(a).slideToggle(250, function () {
                var a = $(this).closest("li");
                $(a).hasClass("expand") ? $(a).removeClass("expand") : $(a).addClass("expand")
            }))
        }), $(".sidebar .nav > .has-sub .sub-menu li.has-sub > a").click(function () {
            if (0 === $(".page-sidebar-minified").length) {
                var a = $(this).next(".sub-menu");
                $(a).slideToggle(250)
            }
        })
    },
    handleMobileSidebarToggle = function () {
        var a = !1;
        $(".sidebar").bind("click touchstart", function (b) {
            0 !== $(b.target).closest(".sidebar").length ? a = !0 : (a = !1, b.stopPropagation())
        }), $(document).bind("click touchstart", function (b) {
            0 === $(b.target).closest(".sidebar").length && (a = !1), b.isPropagationStopped() || a === !0 || ($("#page-container").hasClass("page-sidebar-toggled") && (a = !0, $("#page-container").removeClass("page-sidebar-toggled")), $(window).width() <= 767 && $("#page-container").hasClass("page-right-sidebar-toggled") && (a = !0, $("#page-container").removeClass("page-right-sidebar-toggled")))
        }), $("[data-click=right-sidebar-toggled]").click(function (b) {
            b.stopPropagation();
            var c = "#page-container",
                d = "page-right-sidebar-collapsed";
            d = $(window).width() < 979 ? "page-right-sidebar-toggled" : d, $(c).hasClass(d) ? $(c).removeClass(d) : a !== !0 ? $(c).addClass(d) : a = !1, $(window).width() < 480 && $("#page-container").removeClass("page-sidebar-toggled"), $(window).trigger("resize")
        }), $("[data-click=sidebar-toggled]").click(function (b) {
            b.stopPropagation();
            var c = "page-sidebar-toggled",
                d = "#page-container";
            $(d).hasClass(c) ? $(d).removeClass(c) : a !== !0 ? $(d).addClass(c) : a = !1, $(window).width() < 480 && $("#page-container").removeClass("page-right-sidebar-toggled")
        })
    },
    handleSidebarMinify = function () {
        $("[data-click=sidebar-minify]").click(function (a) {
            a.preventDefault();
            var b = "page-sidebar-minified",
                c = "#page-container";
            $('#sidebar [data-scrollbar="true"]').css("margin-top", "0"), $('#sidebar [data-scrollbar="true"]').removeAttr("data-init"), $("#sidebar [data-scrollbar=true]").stop(), $(c).hasClass(b) ? ($(c).removeClass(b), $(c).hasClass("page-sidebar-fixed") ? (0 !== $("#sidebar .slimScrollDiv").length && ($('#sidebar [data-scrollbar="true"]').slimScroll({
                destroy: !0
            }), $('#sidebar [data-scrollbar="true"]').removeAttr("style")), generateSlimScroll($('#sidebar [data-scrollbar="true"]')), $("#sidebar [data-scrollbar=true]").trigger("mouseover")) : /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) && (0 !== $("#sidebar .slimScrollDiv").length && ($('#sidebar [data-scrollbar="true"]').slimScroll({
                destroy: !0
            }), $('#sidebar [data-scrollbar="true"]').removeAttr("style")), generateSlimScroll($('#sidebar [data-scrollbar="true"]')))) : ($(c).addClass(b), /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ? ($('#sidebar [data-scrollbar="true"]').css("margin-top", "0"), $('#sidebar [data-scrollbar="true"]').css("overflow", "visible")) : ($(c).hasClass("page-sidebar-fixed") && ($('#sidebar [data-scrollbar="true"]').slimScroll({
                destroy: !0
            }), $('#sidebar [data-scrollbar="true"]').removeAttr("style")), $("#sidebar [data-scrollbar=true]").trigger("mouseover"))), $(window).trigger("resize")
        })
    },
    handlePageContentView = function () {
        "use strict";
        $.when($("#page-loader").addClass("hide")).done(function () {
            $("#page-container").addClass("in")
        })
    },
    panelActionRunning = !1,
    handlePanelAction = function () {
        "use strict";
        return !panelActionRunning && (panelActionRunning = !0, $(document).on("hover", "[data-click=panel-remove]", function (a) {
            $(this).attr("data-init") || ($(this).tooltip({
                title: "Remove",
                placement: "bottom",
                trigger: "hover",
                container: "body"
            }), $(this).tooltip("show"), $(this).attr("data-init", !0))
        }), $(document).on("click", "[data-click=panel-remove]", function (a) {
            a.preventDefault(), $(this).tooltip("destroy"), $(this).closest(".panel").remove()
        }), $(document).on("hover", "[data-click=panel-collapse]", function (a) {
            $(this).attr("data-init") || ($(this).tooltip({
                title: "Collapse / Expand",
                placement: "bottom",
                trigger: "hover",
                container: "body"
            }), $(this).tooltip("show"), $(this).attr("data-init", !0))
        }), $(document).on("click", "[data-click=panel-collapse]", function (a) {
            a.preventDefault(), $(this).closest(".panel").find(".panel-body").slideToggle()
        }), $(document).on("hover", "[data-click=panel-reload]", function (a) {
            $(this).attr("data-init") || ($(this).tooltip({
                title: "Reload",
                placement: "bottom",
                trigger: "hover",
                container: "body"
            }), $(this).tooltip("show"), $(this).attr("data-init", !0))
        }), $(document).on("click", "[data-click=panel-reload]", function (a) {
            a.preventDefault();
            var b = $(this).closest(".panel");
            if (!$(b).hasClass("panel-loading")) {
                var c = $(b).find(".panel-body"),
                    d = '<div class="panel-loader"><span class="spinner-small"></span></div>';
                $(b).addClass("panel-loading"), $(c).prepend(d), setTimeout(function () {
                    $(b).removeClass("panel-loading"), $(b).find(".panel-loader").remove()
                }, 2e3)
            }
        }), $(document).on("hover", "[data-click=panel-expand]", function (a) {
            $(this).attr("data-init") || ($(this).tooltip({
                title: "Expand / Compress",
                placement: "bottom",
                trigger: "hover",
                container: "body"
            }), $(this).tooltip("show"), $(this).attr("data-init", !0))
        }), void $(document).on("click", "[data-click=panel-expand]", function (a) {
            a.preventDefault();
            var b = $(this).closest(".panel"),
                c = $(b).find(".panel-body"),
                d = 40;
            if (0 !== $(c).length) {
                var e = $(b).offset().top,
                    f = $(c).offset().top;
                d = f - e
            }
            if ($("body").hasClass("panel-expand") && $(b).hasClass("panel-expand")) $("body, .panel").removeClass("panel-expand"), $(".panel").removeAttr("style"), $(c).removeAttr("style");
            else if ($("body").addClass("panel-expand"), $(this).closest(".panel").addClass("panel-expand"), 0 !== $(c).length && 40 != d) {
                var g = 40;
                $(b).find(" > *").each(function () {
                    var a = $(this).attr("class");
                    "panel-heading" != a && "panel-body" != a && (g += $(this).height() + 30)
                }), 40 != g && $(c).css("top", g + "px")
            }
            $(window).trigger("resize")
        }))
    },
    handleDraggablePanel = function () {
        "use strict";
        var a = $(".panel").parent("[class*=col]"),
            b = ".panel-heading",
            c = ".row > [class*=col]";
        $(a).sortable({
            handle: b,
            connectWith: c,
            stop: function (a, b) {
                b.item.find(".panel-title").append('<i class="fa fa-refresh fa-spin m-l-5" data-id="title-spinner"></i>'), handleSavePanelPosition(b.item)
            }
        })
    },
    handelTooltipPopoverActivation = function () {
        "use strict";
        0 !== $('[data-toggle="tooltip"]').length && $("[data-toggle=tooltip]").tooltip(), 0 !== $('[data-toggle="popover"]').length && $("[data-toggle=popover]").popover()
    },
    handleScrollToTopButton = function () {
        "use strict";
        $(document).scroll(function () {
            var a = $(document).scrollTop();
            a >= 200 ? $("[data-click=scroll-top]").addClass("in") : $("[data-click=scroll-top]").removeClass("in")
        }), $("[data-click=scroll-top]").click(function (a) {
            a.preventDefault(), $("html, body").animate({
                scrollTop: $("body").offset().top
            }, 500)
        })
    },
    handleThemePageStructureControl = function () {
        if ($.cookie && $.cookie("theme")) {
            0 !== $(".theme-list").length && ($(".theme-list [data-theme]").closest("li").removeClass("active"), $('.theme-list [data-theme="' + $.cookie("theme") + '"]').closest("li").addClass("active"));
            var a = "assets/css/theme/" + $.cookie("theme") + ".css";
            $("#theme").attr("href", a)
        }
        $.cookie && $.cookie("sidebar-styling") && 0 !== $(".sidebar").length && "grid" == $.cookie("sidebar-styling") && ($(".sidebar").addClass("sidebar-grid"), $('[name=sidebar-styling] option[value="2"]').prop("selected", !0)), $.cookie && $.cookie("header-styling") && 0 !== $(".header").length && "navbar-inverse" == $.cookie("header-styling") && ($(".header").addClass("navbar-inverse"), $('[name=header-styling] option[value="2"]').prop("selected", !0)), $.cookie && $.cookie("content-gradient") && 0 !== $("#page-container").length && "enabled" == $.cookie("content-gradient") && ($("#page-container").addClass("gradient-enabled"), $('[name=content-gradient] option[value="2"]').prop("selected", !0)), $.cookie && $.cookie("content-styling") && 0 !== $("body").length && "black" == $.cookie("content-styling") && ($("body").addClass("flat-black"), $('[name=content-styling] option[value="2"]').prop("selected", !0)), $(".theme-list [data-theme]").click(function () {
            var a = "assets/css/theme/" + $(this).attr("data-theme") + ".css";
            $("#theme").attr("href", a), $(".theme-list [data-theme]").not(this).closest("li").removeClass("active"), $(this).closest("li").addClass("active"), $.cookie("theme", $(this).attr("data-theme"))
        }), $(".theme-panel [name=header-styling]").on("change", function () {
            var a = 1 == $(this).val() ? "navbar-default" : "navbar-inverse",
                b = 1 == $(this).val() ? "navbar-inverse" : "navbar-default";
            $("#header").removeClass(b).addClass(a), $.cookie("header-styling", a)
        }), $(".theme-panel [name=sidebar-styling]").on("change", function () {
            2 == $(this).val() ? ($("#sidebar").addClass("sidebar-grid"), $.cookie("sidebar-styling", "grid")) : ($("#sidebar").removeClass("sidebar-grid"), $.cookie("sidebar-styling", "default"))
        }), $(".theme-panel [name=content-gradient]").on("change", function () {
            2 == $(this).val() ? ($("#page-container").addClass("gradient-enabled"), $.cookie("content-gradient", "enabled")) : ($("#page-container").removeClass("gradient-enabled"), $.cookie("content-gradient", "disabled"))
        }), $(document).on("change", ".theme-panel [name=content-styling]", function () {
            2 == $(this).val() ? ($("body").addClass("flat-black"), $.cookie("content-styling", "black")) : ($("body").removeClass("flat-black"), $.cookie("content-styling", "default"))
        }), $(document).on("change", ".theme-panel [name=sidebar-fixed]", function () {
            1 == $(this).val() ? (2 == $(".theme-panel [name=header-fixed]").val() && (alert("Default Header with Fixed Sidebar option is not supported. Proceed with Fixed Header with Fixed Sidebar."), $('.theme-panel [name=header-fixed] option[value="1"]').prop("selected", !0), $("#header").addClass("navbar-fixed-top"), $("#page-container").addClass("page-header-fixed")), $("#page-container").addClass("page-sidebar-fixed"), $("#page-container").hasClass("page-sidebar-minified") || generateSlimScroll($('.sidebar [data-scrollbar="true"]'))) : ($("#page-container").removeClass("page-sidebar-fixed"), 0 !== $(".sidebar .slimScrollDiv").length && ($(window).width() <= 979 ? $(".sidebar").each(function () {
                if (!$("#page-container").hasClass("page-with-two-sidebar") || !$(this).hasClass("sidebar-right")) {
                    $(this).find(".slimScrollBar").remove(), $(this).find(".slimScrollRail").remove(), $(this).find('[data-scrollbar="true"]').removeAttr("style");
                    var a = $(this).find('[data-scrollbar="true"]').parent(),
                        b = $(a).html();
                    $(a).replaceWith(b)
                }
            }) : $(window).width() > 979 && ($('.sidebar [data-scrollbar="true"]').slimScroll({
                destroy: !0
            }), $('.sidebar [data-scrollbar="true"]').removeAttr("style"))), 0 === $("#page-container .sidebar-bg").length && $("#page-container").append('<div class="sidebar-bg"></div>'))
        }), $(document).on("change", ".theme-panel [name=header-fixed]", function () {
            1 == $(this).val() ? ($("#header").addClass("navbar-fixed-top"), $("#page-container").addClass("page-header-fixed"), $.cookie("header-fixed", !0)) : (1 == $(".theme-panel [name=sidebar-fixed]").val() && (alert("Default Header with Fixed Sidebar option is not supported. Proceed with Default Header with Default Sidebar."), $('.theme-panel [name=sidebar-fixed] option[value="2"]').prop("selected", !0), $("#page-container").removeClass("page-sidebar-fixed"), 0 === $("#page-container .sidebar-bg").length && $("#page-container").append('<div class="sidebar-bg"></div>')), $("#header").removeClass("navbar-fixed-top"), $("#page-container").removeClass("page-header-fixed"), $.cookie("header-fixed", !1))
        })
    },
    handleThemePanelExpand = function () {
        $(document).on("click", '[data-click="theme-panel-expand"]', function () {
            var a = ".theme-panel",
                b = "active";
            $(a).hasClass(b) ? $(a).removeClass(b) : $(a).addClass(b)
        })
    },
    handleAfterPageLoadAddClass = function () {
        0 !== $("[data-pageload-addclass]").length && $(window).load(function () {
            $("[data-pageload-addclass]").each(function () {
                var a = $(this).attr("data-pageload-addclass");
                $(this).addClass(a)
            })
        })
    },
    handleSavePanelPosition = function (a) {
        "use strict";
        if (0 !== $(".ui-sortable").length) {
            var b = [],
                c = 0;
            $.when($(".ui-sortable").each(function () {
                var a = $(this).find("[data-sortable-id]");
                if (0 !== a.length) {
                    var d = [];
                    $(a).each(function () {
                        var a = $(this).attr("data-sortable-id");
                        d.push({
                            id: a
                        })
                    }), b.push(d)
                } else b.push([]);
                c++
            })).done(function () {
                var c = window.location.href;
                c = c.split("?"), c = c[0], localStorage.setItem(c, JSON.stringify(b)), $(a).find('[data-id="title-spinner"]').delay(500).fadeOut(500, function () {
                    $(this).remove()
                })
            })
        }
    },
    handleLocalStorage = function () {
        "use strict";
        if ("undefined" != typeof Storage && "undefined" != typeof localStorage) {
            var a = window.location.href;
            a = a.split("?"), a = a[0];
            var b = localStorage.getItem(a);
            if (b) {
                b = JSON.parse(b);
                var c = 0;
                $(".panel").parent('[class*="col-"]').each(function () {
                    var a = b[c],
                        d = $(this);
                    a && $.each(a, function (a, b) {
                        var c = $('[data-sortable-id="' + b.id + '"]').not('[data-init="true"]');
                        if (0 !== $(c).length) {
                            var e = $(c).clone();
                            $(c).remove(), $(d).append(e), $('[data-sortable-id="' + b.id + '"]').attr("data-init", "true")
                        }
                    }), c++
                })
            }
        } else alert("Your browser is not supported with the local storage")
    },
    handleResetLocalStorage = function () {
        "use strict";
        $(document).on("click", "[data-click=reset-local-storage]", function (a) {
            a.preventDefault();
            var b = '<div class="modal fade" data-modal-id="reset-local-storage-confirmation">    <div class="modal-dialog">        <div class="modal-content">            <div class="modal-header">                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>                <h4 class="modal-title"><i class="fa fa-refresh m-r-5"></i> Reset Local Storage Confirmation</h4>            </div>            <div class="modal-body">                <div class="alert alert-info m-b-0">Would you like to RESET all your saved widgets and clear Local Storage?</div>            </div>            <div class="modal-footer">                <a href="javascript:;" class="btn btn-sm btn-white" data-dismiss="modal"><i class="fa fa-close"></i> No</a>                <a href="javascript:;" class="btn btn-sm btn-inverse" data-click="confirm-reset-local-storage"><i class="fa fa-check"></i> Yes</a>            </div>        </div>    </div></div>';
            $("body").append(b), $('[data-modal-id="reset-local-storage-confirmation"]').modal("show")
        }), $(document).on("hidden.bs.modal", '[data-modal-id="reset-local-storage-confirmation"]', function (a) {
            $('[data-modal-id="reset-local-storage-confirmation"]').remove()
        }), $(document).on("click", "[data-click=confirm-reset-local-storage]", function (a) {
            a.preventDefault();
            var b = window.location.href;
            b = b.split("?"), b = b[0], localStorage.removeItem(b), location.reload()
        })
    },
    handleIEFullHeightContent = function () {
        var a = window.navigator.userAgent,
            b = a.indexOf("MSIE ");
        (b > 0 || navigator.userAgent.match(/Trident.*rv\:11\./)) && $('.vertical-box-row [data-scrollbar="true"][data-height="100%"]').each(function () {
            var a = $(this).closest(".vertical-box-row"),
                b = $(a).height();
            $(a).find(".vertical-box-cell").height(b)
        })
    },
    handleUnlimitedTabsRender = function () {
        function a(a, b) {
            var d = (parseInt($(a).css("margin-left")), $(a).width()),
                e = $(a).find("li.active").width(),
                f = b > -1 ? b : 150,
                g = 0;
            if ($(a).find("li.active").prevAll().each(function () {
                    e += $(this).width()
                }), $(a).find("li").each(function () {
                    g += $(this).width()
                }), e >= d) {
                var h = e - d;
                g != e && (h += 40), $(a).find(".nav.nav-tabs").animate({
                    marginLeft: "-" + h + "px"
                }, f)
            }
            e != g && g >= d ? $(a).addClass("overflow-right") : $(a).removeClass("overflow-right"), e >= d && g >= d ? $(a).addClass("overflow-left") : $(a).removeClass("overflow-left")
        }

        function b(a, b) {
            var c = $(a).closest(".tab-overflow"),
                d = parseInt($(c).find(".nav.nav-tabs").css("margin-left")),
                e = $(c).width(),
                f = 0,
                g = 0;
            switch ($(c).find("li").each(function () {
                $(this).hasClass("next-button") || $(this).hasClass("prev-button") || (f += $(this).width())
            }), b) {
            case "next":
                var h = f + d - e;
                h <= e ? (g = h - d, setTimeout(function () {
                    $(c).removeClass("overflow-right")
                }, 150)) : g = e - d - 80, 0 != g && $(c).find(".nav.nav-tabs").animate({
                    marginLeft: "-" + g + "px"
                }, 150, function () {
                    $(c).addClass("overflow-left")
                });
                break;
            case "prev":
                var h = -d;
                h <= e ? ($(c).removeClass("overflow-left"), g = 0) : g = h - e + 80, $(c).find(".nav.nav-tabs").animate({
                    marginLeft: "-" + g + "px"
                }, 150, function () {
                    $(c).addClass("overflow-right")
                })
            }
        }

        function c() {
            $(".tab-overflow").each(function () {
                var b = $(this).width(),
                    c = 0,
                    d = $(this),
                    e = b;
                $(d).find("li").each(function () {
                    var a = $(this);
                    c += $(a).width(), $(a).hasClass("active") && c > b && (e -= c)
                }), a(this, 0)
            })
        }
        $('[data-click="next-tab"]').click(function (a) {
            a.preventDefault(), b(this, "next")
        }), $('[data-click="prev-tab"]').click(function (a) {
            a.preventDefault(), b(this, "prev")
        }), $(window).resize(function () {
            $(".tab-overflow .nav.nav-tabs").removeAttr("style"), c()
        }), c()
    },
    handleMobileSidebar = function () {
        "use strict";
        /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) && $("#page-container").hasClass("page-sidebar-minified") && ($('#sidebar [data-scrollbar="true"]').css("overflow", "visible"), $('.page-sidebar-minified #sidebar [data-scrollbar="true"]').slimScroll({
            destroy: !0
        }), $('.page-sidebar-minified #sidebar [data-scrollbar="true"]').removeAttr("style"), $(".page-sidebar-minified #sidebar [data-scrollbar=true]").trigger("mouseover"));
        var a = 0;
        $(".page-sidebar-minified .sidebar [data-scrollbar=true] a").bind("touchstart", function (b) {
            var c = b.originalEvent.touches[0] || b.originalEvent.changedTouches[0],
                d = c.pageY;
            a = d - parseInt($(this).closest("[data-scrollbar=true]").css("margin-top"))
        }), $(".page-sidebar-minified .sidebar [data-scrollbar=true] a").bind("touchmove", function (b) {
            if (b.preventDefault(), /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
                var c = b.originalEvent.touches[0] || b.originalEvent.changedTouches[0],
                    d = c.pageY,
                    e = d - a;
                $(this).closest("[data-scrollbar=true]").css("margin-top", e + "px")
            }
        }), $(".page-sidebar-minified .sidebar [data-scrollbar=true] a").bind("touchend", function (b) {
            var c = $(this).closest("[data-scrollbar=true]"),
                d = $(window).height(),
                e = parseInt($("#sidebar").css("padding-top")),
                f = $("#sidebar").height();
            a = $(c).css("margin-top");
            var g = e;
            $(".sidebar").not(".sidebar-right").find(".nav").each(function () {
                g += $(this).height()
            });
            var h = -parseInt(a) + $(".sidebar").height();
            if (h >= g && d <= g && f <= g) {
                var i = d - g - 20;
                $(c).animate({
                    marginTop: i + "px"
                })
            } else parseInt(a) >= 0 || f >= g ? $(c).animate({
                marginTop: "0px"
            }) : (i = a, $(c).animate({
                marginTop: i + "px"
            }))
        })
    },
    handleUnlimitedTopMenuRender = function () {
        "use strict";

        function a(a, b) {
            var c = $(a).closest(".nav"),
                d = parseInt($(c).css("margin-left")),
                e = $(".top-menu").width() - 88,
                f = 0,
                g = 0;
            switch ($(c).find("li").each(function () {
                $(this).hasClass("menu-control") || (f += $(this).width())
            }), b) {
            case "next":
                var h = f + d - e;
                h <= e ? (g = h - d + 128, setTimeout(function () {
                    $(c).find(".menu-control.menu-control-right").removeClass("show")
                }, 150)) : g = e - d - 128, 0 != g && $(c).animate({
                    marginLeft: "-" + g + "px"
                }, 150, function () {
                    $(c).find(".menu-control.menu-control-left").addClass("show")
                });
                break;
            case "prev":
                var h = -d;
                h <= e ? ($(c).find(".menu-control.menu-control-left").removeClass("show"), g = 0) : g = h - e + 88, $(c).animate({
                    marginLeft: "-" + g + "px"
                }, 150, function () {
                    $(c).find(".menu-control.menu-control-right").addClass("show")
                })
            }
        }

        function b() {
            var a = $(".top-menu .nav"),
                b = $(".top-menu .nav > li"),
                c = $(".top-menu .nav > li.active"),
                d = $(".top-menu"),
                f = (parseInt($(a).css("margin-left")), $(d).width() - 128),
                g = $(".top-menu .nav > li.active").width(),
                h = 0,
                i = 0;
            if ($(c).prevAll().each(function () {
                    g += $(this).width()
                }), $(b).each(function () {
                    $(this).hasClass("menu-control") || (i += $(this).width())
                }), g >= f) {
                var j = g - f + 128;
                $(a).animate({
                    marginLeft: "-" + j + "px"
                }, h)
            }
            g != i && i >= f ? $(a).find(".menu-control.menu-control-right").addClass("show") : $(a).find(".menu-control.menu-control-right").removeClass("show"), g >= f && i >= f ? $(a).find(".menu-control.menu-control-left").addClass("show") : $(a).find(".menu-control.menu-control-left").removeClass("show")
        }
        $('[data-click="next-menu"]').click(function (b) {
            b.preventDefault(), a(this, "next")
        }), $('[data-click="prev-menu"]').click(function (b) {
            b.preventDefault(), a(this, "prev")
        }), $(window).resize(function () {
            $(".top-menu .nav").removeAttr("style"), b()
        }), b()
    },
    handleTopMenuSubMenu = function () {
        "use strict";
        $(".top-menu .sub-menu .has-sub > a").click(function () {
            var a = $(this).closest("li").find(".sub-menu").first(),
                b = $(this).closest("ul").find(".sub-menu").not(a);
            $(b).not(a).slideUp(250, function () {
                $(this).closest("li").removeClass("expand")
            }), $(a).slideToggle(250, function () {
                var a = $(this).closest("li");
                $(a).hasClass("expand") ? $(a).removeClass("expand") : $(a).addClass("expand")
            })
        })
    },
    handleMobileTopMenuSubMenu = function () {
        "use strict";
        $(".top-menu .nav > li.has-sub > a").click(function () {
            if ($(window).width() <= 767) {
                var a = $(this).closest("li").find(".sub-menu").first(),
                    b = $(this).closest("ul").find(".sub-menu").not(a);
                $(b).not(a).slideUp(250, function () {
                    $(this).closest("li").removeClass("expand")
                }), $(a).slideToggle(250, function () {
                    var a = $(this).closest("li");
                    $(a).hasClass("expand") ? $(a).removeClass("expand") : $(a).addClass("expand")
                })
            }
        })
    },
    handleTopMenuMobileToggle = function () {
        "use strict";
        $('[data-click="top-menu-toggled"]').click(function () {
            $(".top-menu").slideToggle(250)
        })
    },
    handleClearSidebarSelection = function () {
        $(".sidebar .nav > li, .sidebar .nav .sub-menu").removeClass("expand").removeAttr("style")
    },
    handleClearSidebarMobileSelection = function () {
        $("#page-container").removeClass("page-sidebar-toggled")
    },
    App = function () {
        "use strict";
        return {
            init: function () {
                this.initLocalStorage(), this.initSidebar(), this.initTopMenu(), this.initPageLoad(), this.initComponent(), this.initThemePanel()
            },
            initSidebar: function () {
                handleSidebarMenu(), handleMobileSidebarToggle(), handleSidebarMinify(), handleMobileSidebar()
            },
            initSidebarSelection: function () {
                handleClearSidebarSelection()
            },
            initSidebarMobileSelection: function () {
                handleClearSidebarMobileSelection()
            },
            initTopMenu: function () {
                handleUnlimitedTopMenuRender(), handleTopMenuSubMenu(), handleMobileTopMenuSubMenu(), handleTopMenuMobileToggle()
            },
            initPageLoad: function () {
                handlePageContentView()
            },
            initComponent: function () {
                handleDraggablePanel(), handleIEFullHeightContent(), handleSlimScroll(), handleUnlimitedTabsRender(), handlePanelAction(), handelTooltipPopoverActivation(), handleScrollToTopButton(), handleAfterPageLoadAddClass()
            },
            initLocalStorage: function () {
                handleLocalStorage()
            },
            initThemePanel: function () {
                handleThemePageStructureControl(), handleThemePanelExpand(), handleResetLocalStorage()
            },
            scrollTop: function () {
                $("html, body").animate({
                    scrollTop: $("body").offset().top
                }, 0)
            }
        }
    }();
Waves.attach(".btn:not(.btn-icon):not(.btn-float)"), Waves.attach(".btn-icon, .btn-float", ["waves-circle", "waves-float"]), Waves.init()
notify=function(msg, type){
    $.growl(
		{
			message: msg
		},
		{
			element: 'body',
			type: type,
			allow_dismiss: true,
			offset: {
				x: 20,
				y: 85
			},
			spacing: 10,
			z_index: 1031,
			delay: 5000,
			timer: 1000,
			mouse_over: false,
			animate: {
				enter: 'animated fadeInRight',
				exit: 'animated fadeOutRight'
			},
		}
	);
};